:root {
    --primary: #1976D2;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --bg-white: #ffffff;
    --bg-gray: #f5f7fa;
    --text: #333333;
    --text-light: #666666;
    --border: #dee2e6;
    --border-radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* 功能页面通用样式 */
.function-page {
    padding: 20px;
    background-color: var(--bg-gray);
    min-height: calc(100vh - 70px);
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    color: var(--secondary);
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 0;
}

/* 搜索表单容器 */
.search-filter {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-light);
}

.search-form {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.search-form .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

/* 操作按钮区域 */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* 数据表格容器 */
.data-section {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-light);
    margin-bottom: 25px;
}

/* 表格样式优化 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th {
    background-color: var(--secondary);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: var(--light);
}

/* 操作列样式 */
.operations {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 按钮样式统一 */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    min-width: 60px;
}

.btn i {
    margin-right: 5px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #1565C0;
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    min-width: 50px;
}

/* 分页样式优化 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.pagination {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
    background-color: var(--bg-white);
}

.pagination-link:hover {
    background-color: var(--light);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.pagination-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
}

/* 模态框样式统一 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
    animation: modalBackdropFadeIn 0.3s ease;
}

@keyframes modalBackdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-white);
    margin: 5% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 600px;
    animation: modalFadeIn 0.3s ease;
    position: relative;
}

@keyframes modalFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--secondary);
}

.close {
    color: var(--text-light);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
}

.close:hover {
    color: var(--danger);
    transform: scale(1.1);
}

/* 表单样式优化 */
.form-container {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background-color: var(--bg-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* 表单操作区域 */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.form-actions .btn {
    min-width: 100px;
    padding: 10px 20px;
}

/* 消息提示样式 */
.message {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 4px solid transparent;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.message i {
    margin-right: 10px;
    font-size: 18px;
}

.success-message {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--success);
    border-color: var(--success);
}

.error-message {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger);
    border-color: var(--danger);
}

.info-message {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

.warning-message {
    background-color: rgba(241, 196, 15, 0.1);
    color: var(--warning);
    border-color: var(--warning);
}

/* 状态标签样式 */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background-color: rgba(46, 204, 113, 0.2);
    color: var(--success);
}

.status-inactive {
    background-color: rgba(149, 165, 166, 0.2);
    color: var(--text-light);
}

.status-pending {
    background-color: rgba(241, 196, 15, 0.2);
    color: var(--warning);
}

.status-deleted {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--danger);
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: var(--text-light);
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--border);
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text);
}

.empty-state p {
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .function-page {
        padding: 15px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .search-form {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .search-form .form-group {
        min-width: auto;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .operations {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* 打印样式 */
@media print {
    .sidebar, .top-nav, .action-bar, .pagination-container {
        display: none;
    }
    
    .function-page {
        padding: 0;
        background: white;
    }
    
    .data-section {
        box-shadow: none;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th, .data-table td {
        padding: 8px;
    }
}

/* 无障碍访问 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: more) {
    :root {
        --border: #000000;
        --shadow: 0 0 0 1px #000000;
        --shadow-light: 0 0 0 1px #000000;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-white: #1e1e1e;
        --bg-gray: #121212;
        --text: #ffffff;
        --text-light: #cccccc;
        --border: #444444;
    }
    
    .data-table tr:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    .modal-content {
        background-color: var(--bg-white);
        color: var(--text);
    }
}